﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    public partial class gd_search : FormBase1
    {
        public gd_search()
        {
            InitializeComponent();
        }

        private void gd_search_Load(object sender, EventArgs e)
        {
            rlue_op.DataSource = my.bw.View_Emp_lite_List("", my.ACID);
            rlue_op.DisplayMember = "EmpName";
            rlue_op.ValueMember = "EmplID";
            dateselect1.lue_date.Properties.DataSource = my.dts;

            dateselect1.lue_date.EditValue = 0;
        }

        private void btn_search_Click(object sender, EventArgs e)
        {
            DateTime? sd = null;
            DateTime? ed = null;
            if (dateselect1.de_sd.EditValue != null)
            {
                sd = dateselect1.de_sd.DateTime;
            }
            if (dateselect1.de_ed.EditValue != null)
            {
                ed = dateselect1.de_ed.DateTime;
            }
            gridControl1.DataSource = my.bw.gd_get_By_date(sd.Value, ed.Value, my.ACID);
        }

        private void btn_print_Click(object sender, EventArgs e)
        {
            gridControl1.ShowPrintPreview();
        }
    }
}